package com.sudo.dao.admin.model.bo;

import com.sudo.common.utils.PatternUtil;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author 为道日损 2020-06-12 13:32
 * webSite：https://www.sudo.ren
 */
@Data
public class SysUserAddBO {

    @NotBlank(message = "用户昵称不能为空")
    private String nickName;

    @NotBlank(message = "用户账号不能为空")
    @Length(min = 4, max = 10, message = "账号必须由4~10个字符组成")
    @Pattern(regexp= PatternUtil.USERNAME,message="账号必须是4~10位数字、字母或下划线")
    private String username;

    @NotBlank(message = "用户密码不能为空")
    @Length(min = 6, max = 10, message = "密码必须由4~10个字符组成")
    @Pattern(regexp=PatternUtil.PASSWORD,message="密码必须是6~10位数字、字母或下划线")
    private String password;

    @NotBlank(message = "角色不能为空")
    @Pattern(regexp=PatternUtil.ROLE_CODE,message="账号必须是4~15位数字、字母或下划线")
    private String roleCode;

    @Length(max = 255,message = "备注最大长度不超过255位")
    private String note;

}
